package _021_10_8

func MLS(arr []int) int {
	arrMap := make(map[int]uint8)
	for i := 0; i < len(arr); i++ {
		arrMap[arr[i]] = 1
	}
	maxLen := 0
	for i := 0; i < len(arr); i++ {
		item := arr[i]
		lineLen := 0
		for _, ok := arrMap[item]; ok; {
			item++
			lineLen++
		}
		if lineLen > maxLen {
			maxLen = lineLen
		}
	}
	return maxLen
}
